#include <conio.h> 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h> 

void inputString(const char * prompt, char * input)

{
	input[0] = 0;
	printf("%s", prompt);
	scanf("%[^\n]", input);
	fflush(stdin);
}

int main()
{
	int ksym, kstr, kslv, p;
	char  line[1000];


	FILE * inFile = NULL;
	inputString("input file name: ", line);
	inFile = fopen(line, "r");
	ksym=0;
	kstr=1;
	kslv=0;
	p=' ';

	while (1)
	{
		int c = fgetc(inFile);
		ksym++;

		if (c == EOF)
			break;
		if ((isspace(c))&&!(isspace(p)))
		{
			kslv=kslv+1;
		}
		if (c=='\n')
		{
			kstr=kstr+1;
		}
		p=c;
	}



	printf("kol-vo simvolov %d ", ksym);
	printf("\n");
	printf("kol-vo strok %d ", kstr);
	printf("\n");
	printf("kol-vo slov %d ", kslv);
	printf("\n");
	system ("PAUSE");
}